package com.youlu.campus.admin.cert;

import org.springframework.core.io.ClassPathResource;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * @author : [dengbo]
 * @className : ResourseUtils
 * @description : [描述说明该类的功能]
 * @createTime : [2023/3/28 17:09]
 */
public class ResourceUtil {
    public static final String FONT_SERVER_DIR = "/data/fonts/";

    private ResourceUtil() {
    }

    public static ClassPathResource getClassResourceByFile(String file) {
        return new ClassPathResource(file);
    }

    public static File getFontFileByFileName(String fileName) {
        return new File(FONT_SERVER_DIR + fileName);
    }

    public static InputStream getFontFileStreamByFileName(String fileName) throws FileNotFoundException {
        return new FileInputStream(new File(FONT_SERVER_DIR + fileName));
    }


}
